// pages/distribution/commission.js

const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {

    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        wx.showLoading({
            title: '加载中...',
        })
        Promise.all([
            app.http.get('account/statistics', {
                data: {
                    type: 2
                }
            }),
            app.http.get('account/config'),
        ]).then(res => {
            // res[0].data.txCondition = parseFloat(res[0].data.profit_widthdraw) >= parseFloat(res[1].data.stroke_amount_withdraw_floor_limit)
            res[0].data.txCondition = true
            res[1].data.sxf = parseFloat(res[1].data.fee_radio) * 100
            this.setData(Object.assign(res[0].data, res[1].data))
            wx.hideLoading()
        }).catch(err => {
            app.wxToast.error(err.message)
        })
    },

    tx() {
        wx.redirectTo({
            url: '/pages/group-head/commission/put-money',
        })
    }
})